package com.wisdudu.blank.ui.login;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.wisdudu.blank.R;
import com.wisdudu.blank.databinding.FragmentGetCodeBinding;
import com.wisdudu.frame.base.BaseFragment;

/**
 * Created by ypp on 2016/10/19.
 */
public class GetCodeFragment extends BaseFragment {

    public static BaseFragment newIntance(String s, String code) {
        Bundle bundle = new Bundle();
        bundle.putString("phone", s);
        bundle.putString("code", code);
        GetCodeFragment fragment = new GetCodeFragment();
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    protected View initBinding(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        FragmentGetCodeBinding mBinding = DataBindingUtil.inflate(inflater, R.layout.fragment_get_code, container, false);
        mBinding.setViewModel(new GetCodeVM(this, mBinding, getArguments().getString("phone"), getArguments().getString("code")));
        return mBinding.getRoot();
    }

    @Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        initToolbar(getToolbar(), "输入验证码");
    }
}
